﻿@{
    ViewBag.Title = "Login";
    Layout = "~/Views/Shared/_UserManage.cshtml";
}
@model BlogUsersSet

<style type="text/css">
    .logo {
        /*background-color: #0094ff;*/
        margin: 50px auto;
        margin-bottom: 10px;
        width: 250px;
        text-align: center;
    }

    .div_body {
        background-color: #faf7f7;
        margin: 0px auto;
        margin-top: 0px;
        width: 250px;
        padding: 30px;
        border-color: #808080;
    }

        .div_body div {
            margin: 5px auto;
            width: 200px;
        }

    .txt_username, .txt_pass {
        width: 200px;
        height: 20px;
    }

    .button {
        width: 75px;
        height: 25px;
    }

    .div_top .login {
        color: #8e5555;
        font-weight: 600;
    }
</style>

@{
    ViewBag.Title = "登录";
}
<div class="logo">
    <a href="/">
        <span style="color:#be7a7a;font-size:30px">嗨 博客</span>
        <img src="~/Imgs/bubble_message_hi_64px_1189254_easyicon.net.png" />
    </a>
</div>
@*Url.RouteUrl("ControllerAction", new { controller = "UserManage", action = "Login" }*@
@*<script type="text/javascript" src="http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js" data-appid="101269561" data-redirecturi="http://haojima.net/test" charset="utf-8"></script>*@
<div class="div_body">
    @using (Ajax.BeginForm(new AjaxOptions()
                        {
                            Url = Url.Content(Request.Url.ToString()),
                            OnSuccess = "OnSuccess",
                            OnFailure = "OnFailure",
                            HttpMethod = "Post"
                        }))
    {
        <div style="">
            用户名：
            <span class="red">*</span>
            <span class="VeriMess">@Html.ValidationMessageFor(t => t.UserName)</span>
        </div>
        <div>
            @Html.TextBoxFor(t => t.UserName, new { @class = "txt_username" })
        </div>
        <div>
            密码：
            <span class="red">*</span>
            <span class="VeriMess">@Html.ValidationMessageFor(t => t.UserPass)</span>
        </div>
        <div>@Html.PasswordFor(t => t.UserPass, new { @class = "txt_pass" })</div>
        <div style="margin-top:10px">
            <div>
                <input class="checked" name="ischeck" id="ischeck" style="" type="checkbox" checked="checked" />自动登录
            </div>
        </div>
        <div style="margin-top:10px;margin-bottom:5px">
            <input class="button" style="margin-right: 5px" type="submit" value="登录" />
            <span class="VeriMess alertMesg"></span>
        </div>
    }
    <div style="margin-top: 5px; margin-bottom: 10px; ">
        <a style="font-size:11px" href="/UserManage/Regis">立即注册</a><span>  </span>
        <a style="font-size:11px" href="/UserManage/ResetPass">忘记密码？</a>
        <div>           
        </div>
        <div style="color:#317d0f;font-size:10px;margin-top:13px">
            (注意：暂时只在Chrome下测试过)
        </div>
    </div>
    <hr />
    <div style="margin-top:10px">
        <div style="color: #269228; font-size: 14px; margin-bottom:10px;"> 第三方账号直接登录</div>
        <a class="QQlogin_a" href="javascript:;" onclick="">
            <img src="~/Imgs/Connect_logo_7.png" @*style="vertical-align: bottom;"*@ />
        </a>
        <a class="Sinalogin_a" href="javascript:;" onclick="">
            <img src="~/Imgs/loginbtn_03.png" />
        </a>        
    </div>
   
    
</div>
@*<script src="~/Scripts/blog/jquery.BlogCommon.js"></script>*@
<script type="text/javascript">

    $(function () {
        //=========================================
        if (!$(".QQlogin_a").attr("qqlogin")) {
            $.post("/UserManage/ThirdLogin", { "loginType": "qq" }, function (obj) {
                $(".QQlogin_a").attr("onclick", "return window.open('" + obj.toString() + "', 'newWindow', 'height=400, width=600, top=100, left=300, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no');");
                $(".QQlogin_a").attr("qqlogin", "ok");
            });
        }

        if (!$(".Sinalogin_a").attr("weibologin")) {
            $.post("/UserManage/ThirdLogin", { "loginType": "sinaweibo" }, function (obj) {
                $(".Sinalogin_a").attr("onclick", "return window.open('" + obj.toString() + "', 'newWindow', 'height=400, width=600, top=100, left=300, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no');");
                $(".Sinalogin_a").attr("weibologin", "ok");
            });
        }
    });
    function OnSuccess(obj) {
        if (ShowAjaxResult(obj, ".alertMesg")) {

        }
    }
    function OnFailure(obj) {
        if (ShowAjaxResult(obj)) {

        }
    }

</script>
